package com.pig4cloud.pig.admin.common;

import com.p6spy.engine.spy.appender.MessageFormattingStrategy;

import java.time.LocalDateTime;

/**
 * @author xianliru
 * @email xianliru@100tal.com
 * @date 2020/4/24 5:20 下午
 */
public class P6SpyLogger implements MessageFormattingStrategy {

    @Override
    public String formatMessage(int i, String s, long l, String s1, String s2, String s3, String s4) {
        return !"".equals(s3.trim()) ? "[ " + LocalDateTime.now() + " ] --- | took "
                + l + "ms | " + s1 + " | connection " + i + "\n "
                + s3 + ";" : "s4: "+ s4;
    }
}
